import { getRequest, postRequest, getDownload,postDownload } from '/@/lib/axios';

// 定义 param 的类型
interface RequestParams {
    [key: string]: any;
}
interface HMIParams {
    [key: string]: any;
}
export const rollingSimulationApi = {
    // 轧制能力仿真列表请求数据
    rest: (param: RequestParams, config?: any) => {
        return getRequest('/api/restapi', param, config);
    },
    // 轧制能力仿真列表请求数据
    HMI: (param: HMIParams, config?: any) => {
        return postRequest('/mapi/HMI', param, config);
    },
    // 轧制能力仿真列表请求数据
    updateCase: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/optimize/updateCase', param, config);
    },
    // 酸轧生产实绩
    findData: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/optimize/findData', param, config);
    },
    // 酸轧生产实绩查看接口
    findAcidRollingProduct: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/optimize/findAcidRollingProduct', param, config);
    },
    // 仿真案例管理列表
    findCaseData: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/optimize/findCaseData', param, config);
    },
    //负荷分配优化
    findLoadDistributionData:(param: HMIParams, config?: any)=>{
        return postRequest('/eapi/optimize/findLoadDistributionData', param, config);
    },
    exportLoadDistributionXlsx(param:any){
        return postDownload('/eapi/optimize/exportLoadDistributionXlsx ', param);
    },
    // 仿真案例管理列表查看
    findCase: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/optimize/findCase', param, config);
    },
    // 仿真案例管理列表删除
    deleteCase: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/optimize/deleteCase', param, config);
    },
    // 酸轧计划数据
    getAcidPlanData: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/acid/getAcidPlanData', param, config);
    },
    // 批量导入数据
    importData: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/optimize/acidRolling/import/data', param, config);
    },
    // 下载模板
    exportTemplate: (param: RequestParams, config?: any) => {
        return getDownload('/eapi/optimize/acidRolling/export/template', param);
    },

    // 钢卷信息
    getSteelInfo: (param: any, config?: any) => {
        return postRequest('/eapi/tPdiDataL3Tcm2280/get_allprocessproduct', param, config);
    },

    // 批量导入数据
    simulationReport: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/optimize/acidRolling/simulationReport', param, config);
    },
    // 批量导入数据
    classStatistics: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/optimize/acidRolling/classStatistics', param, config);
    },
    // 批量导入数据
    findByYpClass: (param: HMIParams, config?: any) => {
        return postRequest('/eapi/optimize/acidRolling/findByYpClass', param, config);
    },
    // 酸轧产品数据导出
    exportAcidRollingProduct: (param: HMIParams, config?: any) => {
        return getDownload('/eapi/optimize/acidRollingProduct/export', param);
    },
};
